import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '订单号',
    align:"center",
    dataIndex: 'orderNo'
   },
   {
    title: '保单号',
    align:"center",
    width: 180,
    dataIndex: 'policyNo'
   },
  {
    title: '发票申请时间',
    align: 'center',
    dataIndex: 'invoiceApplyDate'
  },
   {
    title: '下单时间',
    align:"center",
    dataIndex: 'policyInsurDate'
   },
  {
    title: '保险状态',
    align:"center",
    width: 80,
    dataIndex: 'policyState_dictText'
  },
  {
    title: '付款状态',
    width: 80,
    align:"center",
    dataIndex: 'payState_dictText'
  },
  {
    title: '付款人名称',
    width: 250,
    align:"center",
    dataIndex: 'recAccountName'
  },
  {
    title: '支付时间',
    align:"center",
    dataIndex: 'payTime'
  },
   {
    title: '区域',
     width: 80,
    align:"center",
    dataIndex: 'areaId_dictText'
   },
   {
    title: '保险种类',
    align:"center",
    dataIndex: 'insuranceType_dictText'
   },
  {
    title: '项目编号',
    align: "center",
    dataIndex: 'projectId'
  },
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'projectName'
   },
   {
    title: '被保人名称',
    align:"center",
    dataIndex: 'insuredName'
   },
   {
    title: '投保人名称',
    align:"center",
    dataIndex: 'policyHolderName'
   },
   {
    title: '投保联系人',
    align:"center",
    dataIndex: 'policyLinkmanName'
   },
   {
    title: '投保联系人电话',
    align:"center",
    dataIndex: 'policyLinkmanMobilename'
   },
  {
    title: '发票状态',
    align:"center",
    dataIndex: 'invoiceState_dictText'
  },
  {
    title: '发票类型',
    align:"center",
    dataIndex: 'invoiceType_dictText'
  },
   {
    title: '保费',
    align:"center",
    dataIndex: 'premium'
   },
   {
    title: '保险公司',
    align:"center",
    dataIndex: 'insuranceCompany_dictText'
   },
   {
    title: '邀请码',
    align:"center",
    dataIndex: 'invitationCode'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "订单号",
      field: "orderNo",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "保单号",
      field: "policyNo",
      component: 'JInput',
      colProps: {span: 6},
 	},
     {
      label: "下单时间",
      field: "policyInsurDate",
      component: 'RangePicker',
      componentProps: {
          showTime:true
      },
      colProps: {span: 6},
	},
	{
      label: "区域",
      field: "areaId",
      component: 'JSelectDept',
      colProps: {span: 6},
 	},
	{
      label: "保险种类",
      field: "insuranceType",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"BXZL"
      },
      colProps: {span: 6},
 	},
	{
      label: "项目名称",
      field: "projectName",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "项目编号",
      field: "projectId",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "被保人名称",
      field: "insuredName",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "投保人名称",
      field: "policyHolderName",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "投保联系人",
      field: "policyLinkmanName",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "投保联系人电话",
      field: "policyLinkmanMobilename",
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "保费",
      field: "premium",
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "保险状态",
      field: "policyState",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"BXZT"
      },
      colProps: {span: 6},
 	},
	{
      label: "保险公司",
      field: "insuranceCompany",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"BXGS"
      },
      colProps: {span: 6},
 	},
	{
      label: "付款状态",
      field: "payState",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"ZFZT"
      },
      colProps: {span: 6},
 	},
	{
      label: "邀请码",
      field: "invitationCode",
      component: 'JInput',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '订单号',
    field: 'orderNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入订单号!'},
          ];
     },
  },
  {
    label: '保单号',
    field: 'policyNo',
    component: 'Input',
  },
  {
    label: '下单时间',
    field: 'policyInsurDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '支付时间',
    field: 'payTime',
    component: 'DatePicker',
    componentProps: {
      showTime:true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '指令编号',
    field: 'orderFlowNo',
    component: 'Input',
  },
  {
    label: '区域',
    field: 'areaId',
     component: 'JSelectDept',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入区域!'},
          ];
     },
  },
  {
    label: '保险种类',
    field: 'insuranceType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"BXZL"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险种类!'},
          ];
     },
  },
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目名称!'},
          ];
     },
  },
  {
    label: '项目编号',
    field: 'projectId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目编号!'},
          ];
     },
  },
  {
    label: '被保人名称',
    field: 'insuredName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入被保人名称!'},
          ];
     },
  },
  {
    label: '投保人名称',
    field: 'policyHolderName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入投保人名称!'},
          ];
     },
  },
  {
    label: '投保联系人',
    field: 'policyLinkmanName',
    component: 'Input',
  },
  {
    label: '投保联系人电话',
    field: 'policyLinkmanMobilename',
    component: 'Input',
  },
  {
    label: '保费',
    field: 'premium',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保费!'},
          ];
     },
  },
  {
    label: '发票状态',
    field: 'invoiceState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"FPZT"
    },
  },
  {
    label: '发票类型',
    field: 'InvoiceType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"FPLX"
    },
  },
  {
    label: '保险状态',
    field: 'policyState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"BXZT"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险状态!'},
          ];
     },
  },
  {
    label: '保险公司',
    field: 'insuranceCompany',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"BXGS"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险公司!'},
          ];
     },
  },
  {
    label: '付款状态',
    field: 'payState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"ZFZT"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入付款状态!'},
          ];
     },
  },
  {
    label: '邀请码',
    field: 'invitationCode',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
export const insurancePolicyFormSchema: FormSchema[] = [
  {
    label: '保单号',
    field: 'policyNo',
    component: 'Input',
  },
  {
    label: '保险公司',
    field: 'insuranceCompany',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"BXGS"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险公司!'},
          ];
     },
  },
  {
    label: '地区编码',
    field: 'area',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入地区编码!'},
          ];
     },
  },
  {
    label: '保险种类',
    field: 'insuranceType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"BXZL"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险种类!'},
          ];
     },
  },
  {
    label: '保险产品代码',
    field: 'insuranceCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险产品代码!'},
          ];
     },
  },
  {
    label: '保险份数',
    field: 'copies',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险份数!'},
          ];
     },
  },
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目名称!'},
          ];
     },
  },
  {
    label: '项目类型',
    field: 'projectType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"XMLX"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目类型!'},
          ];
     },
  },
  {
    label: '项目编号',
    field: 'projectId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入项目编号!'},
          ];
     },
  },
  {
    label: '招标人名称（被保人）',
    field: 'insuredName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入招标人名称（被保人）!'},
          ];
     },
  },
  {
    label: '招标人统一社会信用证代码',
    field: 'insuredUcc',
    component: 'Input',
  },
  {
    label: '招标人联系电话',
    field: 'insuredLinkmanName',
    component: 'Input',
  },
  {
    label: '投保人名称',
    field: 'policyHolderName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入投保人名称!'},
          ];
     },
  },
  {
    label: '投保人证件类型',
    field: 'policyIdType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"ZJLX"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入投保人证件类型!'},
          ];
     },
  },
  {
    label: '投保人社会统一信用代码',
    field: 'policyUcc',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入投保人社会统一信用代码!'},
          ];
     },
  },
  {
    label: '投保联系人名称',
    field: 'policyLinkmanName',
    component: 'Input',
  },
  {
    label: '投保联系人手机号',
    field: 'policyLinkmanMobilename',
    component: 'Input',
  },
  {
    label: '保额',
    field: 'premium',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保额!'},
          ];
     },
  },
  {
    label: '费率',
    field: 'rate',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入费率!'},
          ];
     },
  },
  {
    label: '保险状态',
    field: 'policyState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"TBBXZT"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入保险状态!'},
          ];
     },
  },
  {
    label: '投保日期',
    field: 'insureDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入投保日期!'},
          ];
     },
  },
  {
    label: '出保时间',
    field: 'insureActiveDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '保险起始日期',
    field: 'insureStartDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '保险终止日期',
    field: 'insureEndDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '特别约定',
    field: 'specialAgreement',
    component: 'Input',
  },
  {
    label: '保单下载地址',
    field: 'policyDownloadUrl',
    component: 'Input',
  },
  ,
  {
    label: '发票申请时间',
    field: 'invoiceApplyDate',
    component: 'DatePicker',
    componentProps: {
      showTime:true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '发票状态',
    field: 'invoiceState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"FPZT"
     },
  },
  {
    label: '发票类型',
    field: 'invoiceType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"FPLX"
     },
  },
  {
    label: '发票下载地址',
    field: 'invoiceDownloadUrl',
    component: 'Input',
  },
  {
    label: '发票接收邮箱',
    field: 'invoiceEmail',
    component: 'Input',
  },
  {
    label: '发票收件人',
    field: 'invoiceAddressee',
    component: 'Input',
  },
  {
    label: '发票收件人手机号',
    field: 'invoiceAddresseePhone',
    component: 'Input',
  },
  {
    label: '发票收件地址',
    field: 'invoiceAddress',
    component: 'Input',
  },
  {
    label: '发票抬头',
    field: 'invoiceHead',
    component: 'Input',
  },
  {
    label: '纳税人识别号',
    field: 'invoiceCuscCode',
    component: 'Input',
  },
  {
    label: '注册地址',
    field: 'invoiceRegisteredAddress',
    component: 'Input',
  },
  {
    label: '开户行',
    field: 'invoiceBankInfo',
    component: 'Input',
  },
  {
    label: '开户帐号',
    field: 'invoiceBankAcc',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'invoicePhoneNo',
    component: 'Input',
  },
  {
    label: '区域',
    field: 'areaId',
     component: 'JSelectDept',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入区域!'},
          ];
     },
  },
  {
    label: '开标日期',
    field: 'openDate',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '保证金',
    field: 'bond',
    component: 'InputNumber',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表表格配置
